package com.hyw.cm.protocal.service;

import com.hyw.cm.common.protocal.spi.IMessage;

/**
 * 抽象读写.
 * <li>读时流程为：isReadSupport-->read-->afterRead
 * 
 * @author Hongyu
 */
public interface IBusinessProtocalService {

  boolean isReadSupport(byte[] packet);

  IMessage read(byte[] packet);

  /**
   * 业务逻辑入口
   * 
   * @param msg
   */
  void afterRead(IMessage msg);

  boolean isWriteSupport(IMessage msg);

  void write(IMessage msg);

}
